﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Model;
using Controller;

namespace Facade.Validator
{
    public class TypeKPIValidator
    {
        public string ValidateOnSave(TypeKPI Types)
        {
            string msg = "OK";
            if (Types.Description.Trim().Length <= 0)
                msg = "Please Enter Type KPI Description";
            if (Types.GroupKPI == null)
                msg = "Please Enter Group KPI";
            if (Types.CategoryKPI == null)
                msg = "Please Enter Category KPI";
            if (Types.Sequence.ToString().Trim().Length <= 0)
                msg = "Please Enter Order Row";
            return msg;
        }

        public string ValidateOnUpdate(TypeKPI Types)
        {
            string msg = "OK";
            if (Types.Description.Trim().Length <= 0)
                msg = "Please Enter Category KPI Description";
            if (Types.GroupKPI == null)
                msg = "Please Enter Group KPI";
            if (Types.CategoryKPI == null)
                msg = "Please Enter Category KPI";
            if (Types.Sequence.ToString().Trim().Length <= 0)
                msg = "Please Enter Order Row";
            return msg;
        }
    }
}